﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Playbook.Core.ViewModel
{
    /// <summary>
    /// Identifies a member.
    /// </summary>
    public sealed class MemberViewModel : ViewModelBase
    {
        private string _name;
        private string _imageUrl;
        private string _email;
        private string _roles;
        private MemberStatuses _status;
        private ObservableCollection<CommentViewModel> _comments;

        public MemberViewModel() : base() { }

        public MemberViewModel(string email, string password)
            : base()
        {
           
            
        }

        /// <summary>
        /// Name of the member.
        /// </summary>
        public string Name { get { return _name; } set { _name = value; base.RaisePropertyChanged("Name"); } }

        /// <summary>
        /// Path to the member's image.
        /// </summary>
        public string ImageURL { get { return _imageUrl; } set { _imageUrl = value; base.RaisePropertyChanged("ImageURL"); } }

        /// <summary>
        /// Member's email address.
        /// </summary>
        public string Email { get { return _email; } set { _email = value; base.RaisePropertyChanged("Email"); } }

        /// <summary>
        /// Roles the member enjoys.
        /// </summary>
        public string Roles { get { return _roles; } set { _roles = value; base.RaisePropertyChanged("Roles"); } }

        /// <summary>
        /// The current status of the member.
        /// </summary>
        public MemberStatuses Status { get { return _status; } set { _status = value; base.RaisePropertyChanged("Status"); } }

        /// <summary>
        /// Comments associated with this Member.
        /// </summary>
        public ObservableCollection<CommentViewModel> Comments
        {
            get
            {
                if (_comments == null) { _comments = new ObservableCollection<CommentViewModel>(); }
                return _comments;
            }
            set
            {
                _comments = value;
                base.RaisePropertyChanged("Comments");
            }
        }
    }
}
